import {N as dayjs} from "./index-Dfdf_Rjk.js";

function getHashHueFromString(name) {
    let hash = 111;
    for (let i = 0; i < name.length; i++)
        hash = (hash << 5) + hash + name.charCodeAt(i);
    hash = Math.abs(hash);
    const goldenRatio = 0.618033988749895;
    const hue = hash * goldenRatio * goldenRatio % 1 * 360;
    return Math.floor(hue);
}

function getHashColorFromString(name, opacity = 1) {
    const h = getHashHueFromString(name);
    return getHsla(h, opacity);
}

function getHsla(hue, opacity = 1) {
    const saturation = 65;
    const lightness = 45;
    return "hsla(".concat(hue, ", ").concat(saturation, "%, ").concat(lightness, "%, ").concat(opacity, ")");
}

const DATE_TIME_FORMAT = "YYYY-MM-DD HH:mm:ss";

function formatToDateTime(date = null, format = DATE_TIME_FORMAT) {
    return dayjs(date).format(format);
}

export {
    formatToDateTime as f,
    getHashColorFromString as g
};
